﻿@using thousandclear.Data
@model List<T_Reward>



@{
    ViewBag.Title = "管家打赏记录";
    Layout = "~/Areas/Admin/Views/Shared/_Admin.cshtml";
}

<div id="app">
    <div class="am-cf am-padding">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">后台管理</strong> / <small>@ViewBag.Title</small></div>
    </div>

    <div class="am-g">
        <div class="am-g">
            <div class="am-u-sm-12 am-u-md-3">
                <div class="am-form-group">
                    <label>状态：</label>
                    <select v-model="status">
                        <option value="">全部</option>
                        <option value="1">已结算</option>
                        <option value="2">未结算</option>
                    </select>
                    <div class="am-u-sm-12 am-u-md-3">
                        <div class="am-form-group">
                            <label>昵称：</label>
                            <input type="text" class="am-input-sm" v-model="name" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="am-u-sm-12 am-u-md-12">
                <button class="am-btn am-btn-primary" v-on:click="search">查询</button>
            </div>
            <div class="am-u-sm-12" style="overflow:auto;">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                        <tr>
                            <th>昵称</th>
                            <th>打赏积分</th>
                            <th>打赏日期</th>
                            <th>结算状态</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var i in Model)
                        {
                            <tr>
                                <td>@i.UpdatedBy</td>
                                <td>@i.trTotolRate</td>
                                <td>@i.CreatedDate</td>
                                @if (i.RowStatus == 1)
                                {
                                    <td>已结算</td>
                                }
                                @if (i.RowStatus == 2)
                                {
                                    <td>未结算</td>
                                }
                                <td>
                                    <div class="am-btn-toolbar" style="float:left;  margin-left:5px;">
                                        <div class="am-btn-group am-btn-group-xs">
                                            <a href="~/admin/order/detail?toSerialNo=@i.TRID" class="am-btn am-btn-primary am-btn-xs am-hide-sm-only"><span class="am-icon-edit"></span>结算</a>
                                        </div>
                                    </div>
                                </td>

                            </tr>
                        }
                    </tbody>
                </table>
                <div class="am-cf">
                    &nbsp;&nbsp;共 {{totalCount}} 条记录, 每页 {{pageCount}} 条记录
                    <div class="am-fr">
                        <ul class="am-pagination">
                            <li style="width: 60px">
                                <input class="am-form-field" style="text-align:center" type="text" v-model="gotoPage" />
                            </li>
                            <li><a href="#" v-on:click="goto">GoTo &raquo;</a></li>
                            <li><a href="#" v-on:click="prev">&laquo; Prev</a></li>
                            <li><span>{{currentPage}}/{{totalPage}}</span></li>
                            <li><a href="#" v-on:click="next">Next &raquo;</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <script>
        var model = new Vue({
            el: '#app',
            data: {
                totalCount: @ViewBag.TotalCount,
                currentPage: @ViewBag.CurrentPage,
                pageCount: @ViewBag.PageCount,
                gotoPage: @ViewBag.CurrentPage,
                totalPage: @ViewBag.TotalPage,
                status:'',
                name:'',
                id:'@ViewBag.id',
            },
            methods: {
                prev: function () {
                    var self = this;
                    if (self.currentPage <= 1)
                        return;

                    self.currentPage -= 1;
                    self.load();
                },
                next: function () {
                    var self = this;

                    if (self.currentPage >= self.totalPage)
                        return;

                    self.currentPage += 1;

                    self.load();
                },
                goto: function () {
                    var self = this;
                    self.currentPage = self.gotoPage;
                    self.load();
                },
                search: function () {
                    var self = this;
                    self.currentPage = 1;
                    self.load();
                },
                load: function () {
                    var self = this;
                    window.location.href = "../Aunt/logDetail?page=" + self.currentPage + "&count=" + self.pageCount + "&status=" + self.status+"&name=" + self.name+"&id=" + self.id;
                },

            }
        });



        $('.admin-sidebar-order').addClass('current');







    </script>
}
